#pragma once

#define LabPluginClassName "LabPluginClass"
#define WaveConverterClassName "WaveConverterClass"

class IPC
{
public:
	typedef enum
	{
		IPCCommandUnknown   = -1,
		IPCCommandAddFile   = 0 ,
		IPCCommandAddFolder = 1 ,
		IPCCommandStartToConvert = 2,
		IPCCommandConvertingComplete = 3
	}IPCCommand;

	typedef	struct {
		IPCCommand command;
		TCHAR* szCommand;
	}COMMAND_INFO;

	static COMMAND_INFO arCOMMAND_INFO[];

	static CString GenCommand(IPCCommand command);
	static CString GenCommand(IPCCommand command,const CString& p1);
	static CString GenCommand(IPCCommand command,const CString& p1,const CString& p2);
	static IPCCommand ParseCommand(const CString& strCommand,CStringArray& parms);
	static CString GetCommandDescription(IPCCommand command);
	static IPCCommand GetCommandType(const CString& strCommand);

	static BOOL SendToConverter( LPCTSTR lpszFormat, ... );
	static BOOL SendToConverter( TCHAR* msg );
	static LONG OpenConverterWindow();

	static BOOL SendToLabPlugin( LPCTSTR lpszFormat, ... );
	static BOOL SendToLabPlugin( TCHAR* msg );

	static BOOL SendMessageAddFile(const CString& source, const CString& destination);
	static BOOL SendMessageAddFolder(const CString& folder);
	static BOOL SendMessageStartToConvert();
	
	static BOOL SendMessageConvertingComplete();

	static CString pathConverter;
	static CString strWaveConverterClassName;
	static CString strLabPluginClassName;
	static BOOL bNotifyOnceIfErrorHappen;
	static HWND hWndLabPlugin;
	static void SetHwndLabPlugin(HWND hWnd);
};
